using System.Collections;
using System.Collections.Generic;
using Platform.Skill.Deployer;
using UnityEngine;

namespace GardeningSkeleton.Platform.SkillSpace
{
    /// <summary>
    /// 插入对方
    /// </summary>
    public class InsertImpact : BaseImpactEffect
    {
        ParabolicSkillDeployer deployer;

        public override void EndEffect()
        {
            if (deployer is ThrowSwordSkillDeployer)
                deployer.ReturnSword();
        }

        public override void Execute(SkillDeployer baseDeployer)
        {
            deployer = (ParabolicSkillDeployer)baseDeployer;
        }

        public override void OnImpactTriggerEntry(Collider2D other)
        {
            deployer.StopRigidbody();
            deployer.transform.parent = other.transform;
            deployer.AttackStart(other);
        }
    }
}